class Tank {
    int level;
}


public class Assignment {
    public static void main(String[] args) {
        Tank tank1 = new Tank();
        Tank tank2 = new Tank();
        tank1.level = 5;
        tank2.level = 10;

        // Assigning the reference of tank1 to tank2
        tank2 = tank1;

        // Now both tank1 and tank2 point to the same object
        System.out.println("Tank1 level: " + tank1.level); // Output: 5
        System.out.println("Tank2 level: " + tank2.level); // Output: 5

        // Changing the level of tank1
        tank1.level = 20;

        // Both tanks reflect the change
        System.out.println("Tank1 level after change: " + tank1.level); // Output: 20
        System.out.println("Tank2 level after change: " + tank2.level); // Output: 20
    }

}
